import sys
import os
from PyQt5.QtWidgets import QApplication
import qdarkstyle
from traffic_analysis.ui.main_window import MainWindow

# Add the project root directory to Python path
# 设置工作目录为脚本所在目录
# 获取当前文件的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
# 获取项目根目录
project_root = os.path.dirname(current_dir)
# 将项目根目录添加到 Python 路径
sys.path.insert(0, project_root)

if __name__ == '__main__':
    app = QApplication(sys.argv)
    app.setStyleSheet(qdarkstyle.load_stylesheet())

    window = MainWindow()
    window.show()

    sys.exit(app.exec_())